#include<iostream>
#include<vector>
#include<fstream>
using namespace std;

void printvector(vector<int> &v)
{
        cout << "V:" << v.size() << "[ ";
        for(int i=0;i<v.size();i++)
        {
                cout << v[i] << " ";
        }
        cout << "]" << endl;
}

vector<int> v1;
vector<int> v2;
vector<int> v;

int main(int, char**)
{
	ifstream fi("input1.txt");
	ofstream fo("output.txt");
	int i;
	while(fi >> i)
	{
		v1.push_back(i);
	}
	printvector(v1);
	fi.close();
	fi.open("input2.txt");
	while(fi >> i)
        {
                v2.push_back(i);
        }
        printvector(v2);
	int a=0;
	int b=0;
	int c=0;
	for(;(a<v1.size())&&(b<v2.size());c++)
	{
		if(v1[a]<v2[b])
		{
			v.push_back(v1[a]);
			a++;
		}
		else
		{
			v.push_back(v2[b]);
			b++;
		}
		c++;
	}
	if(a<b)
	{
		for(;a<v1.size();a++)
		{
			v.push_back(v1[a]);
		}
	}
	else
	{
		for(;b<v2.size();b++)
		{
			v.push_back(v2[b]);
		}
	}
	printvector(v);
}

